home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / crwdemo / server.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  7.0 KB  |  244 lines

  1. VERSION 2.00
  2. Begin Form SetLogon 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "SQL Server"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   3060
  7.    ClientTop       =   3105
  8.    ClientWidth     =   5835
  9.    Height          =   4755
  10.    Left            =   3000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4065
  13.    ScaleWidth      =   5835
  14.    Top             =   2475
  15.    Width           =   5955
  16.    Begin SSPanel Statusbar 
  17.       Alignment       =   1  'Left Justify - MIDDLE
  18.       BorderWidth     =   1
  19.       FontBold        =   0   'False
  20.       FontItalic      =   0   'False
  21.       FontName        =   "MS Sans Serif"
  22.       FontSize        =   8.25
  23.       FontStrikethru  =   0   'False
  24.       FontUnderline   =   0   'False
  25.       Height          =   375
  26.       Left            =   0
  27.       TabIndex        =   12
  28.       Top             =   3720
  29.       Width           =   6855
  30.    End
  31.    Begin CommandButton Command4 
  32.       Caption         =   "Clear Settings"
  33.       Height          =   375
  34.       Left            =   3330
  35.       TabIndex        =   11
  36.       Top             =   1260
  37.       Width           =   1575
  38.    End
  39.    Begin CommandButton Command3 
  40.       Caption         =   "Get Info"
  41.       Height          =   375
  42.       Left            =   3330
  43.       TabIndex        =   10
  44.       Top             =   360
  45.       Width           =   1575
  46.    End
  47.    Begin TextBox Text4 
  48.       Height          =   375
  49.       Left            =   240
  50.       PasswordChar    =   "*"
  51.       TabIndex        =   8
  52.       Top             =   2520
  53.       Width           =   2175
  54.    End
  55.    Begin TextBox Text3 
  56.       Height          =   375
  57.       Left            =   240
  58.       TabIndex        =   4
  59.       Top             =   1800
  60.       Width           =   2175
  61.    End
  62.    Begin TextBox Text2 
  63.       Height          =   375
  64.       Left            =   240
  65.       TabIndex        =   3
  66.       Top             =   1080
  67.       Width           =   2175
  68.    End
  69.    Begin TextBox Text1 
  70.       Height          =   375
  71.       Left            =   240
  72.       TabIndex        =   2
  73.       Top             =   360
  74.       Width           =   2175
  75.    End
  76.    Begin CommandButton Command2 
  77.       Caption         =   "Set Info"
  78.       Height          =   375
  79.       Left            =   3330
  80.       TabIndex        =   1
  81.       Top             =   810
  82.       Width           =   1575
  83.    End
  84.    Begin CommandButton Command1 
  85.       Caption         =   "Close"
  86.       Height          =   375
  87.       Left            =   3330
  88.       TabIndex        =   0
  89.       Top             =   2475
  90.       Width           =   1575
  91.    End
  92.    Begin Label Label4 
  93.       BackColor       =   &H00C0C0C0&
  94.       Caption         =   "Password"
  95.       ForeColor       =   &H00000000&
  96.       Height          =   255
  97.       Left            =   240
  98.       MousePointer    =   11  'Hourglass
  99.       TabIndex        =   9
  100.       Top             =   2280
  101.       Width           =   1455
  102.    End
  103.    Begin Label Label3 
  104.       BackColor       =   &H00C0C0C0&
  105.       Caption         =   "User ID"
  106.       Height          =   255
  107.       Left            =   240
  108.       TabIndex        =   7
  109.       Top             =   1560
  110.       Width           =   1695
  111.    End
  112.    Begin Label Label2 
  113.       BackColor       =   &H00C0C0C0&
  114.       Caption         =   "Database Name"
  115.       Height          =   255
  116.       Left            =   240
  117.       TabIndex        =   6
  118.       Top             =   840
  119.       Width           =   1695
  120.    End
  121.    Begin Label Label1 
  122.       BackColor       =   &H00C0C0C0&
  123.       Caption         =   "Server Name"
  124.       Height          =   255
  125.       Left            =   240
  126.       TabIndex        =   5
  127.       Top             =   120
  128.       Width           =   1695
  129.    End
  130.    Begin Menu MenuFileSQLLogon 
  131.       Caption         =   "&File"
  132.       Begin Menu MenuFileExit 
  133.          Caption         =   "&Exit"
  134.       End
  135.    End
  136. Dim DLLName As String
  137. Sub Command1_Click ()
  138.  Unload Me
  139. End Sub
  140. Sub Command2_Click ()
  141.     If JobNum = 0 Then
  142.         MsgBox "No job open."
  143.         Exit Sub
  144.     End If
  145.     Dim logonInfo As PELogonInfo
  146.     logonInfo.StructSize = Len(logonInfo)
  147.     logonInfo.ServerName = Text1.Text + Chr$(0)
  148.     logonInfo.DatabaseName = Text2.Text + Chr$(0)
  149.     logonInfo.UserID = Text3.Text + Chr$(0)
  150.     logonInfo.Password = Text4.Text + Chr$(0)
  151.     If PESetNthTableLogonInfo(JobNum, 0, logonInfo, 1) = 1 Then
  152.         Statusbar.Caption = "Logon Info has been Set."
  153.     Else
  154.       RCode = GetErrorString(JobNum)
  155.       MsgBox "PESetNthTableLogonInfo Error #: " + Str(ErrorCode) + " - " + RCode
  156.     End If
  157. End Sub
  158. Sub Command3_Click ()
  159.     If JobNum = 0 Then
  160.         MsgBox "No job open."
  161.         Exit Sub
  162.     End If
  163.     Dim logonInfo As PELogonInfo
  164.     logonInfo.StructSize = Len(logonInfo)
  165.     logonInfo.ServerName = Chr$(0)
  166.     logonInfo.DatabaseName = Chr$(0)
  167.     logonInfo.UserID = Chr$(0)
  168.     logonInfo.Password = Chr$(0)
  169.     If PEGetNthTableLogonInfo(JobNum, 0, logonInfo) = 1 Then
  170.         Text1.Text = logonInfo.ServerName
  171.         Text2.Text = logonInfo.DatabaseName
  172.         Text3.Text = logonInfo.UserID
  173.         Statusbar.Caption = "Logon info has returned."
  174.     Else
  175.       RCode = GetErrorString(JobNum)
  176.       MsgBox "PEGetNthTableLogonInfo Error #: " + Str(ErrorCode) + " - " + RCode
  177.        
  178.     End If
  179. End Sub
  180. Sub Command4_Click ()
  181.   Text1.Text = " "
  182.   Text2.Text = " "
  183.   Text3.Text = " "
  184. End Sub
  185. Sub Command5_Click ()
  186. Dim locInfo As PETableLocation
  187.     locInfo.Location = Chr$(0)
  188.     locInfo.StructSize = Len(locInfo)
  189.     If PEGetNthTableLocation(JobNum, tableN, locInfo) = 1 Then
  190.         'Text5.Text = locInfo.Location
  191.     Else
  192.       RCode = GetErrorString(JobNum)
  193.       MsgBox "PEGetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  194.        
  195.       Exit Sub
  196.     End If
  197. End Sub
  198. Sub Command6_Click ()
  199.     Dim locInfo As PETableLocation
  200.     locInfo.StructSize = Len(locInfo)
  201.     'locInfo.Location = Text5.Text + Chr$(0)
  202.     If PESetNthTableLocation(JobNum, tableN, locInfo) = 1 Then
  203.         MsgBox "Location info set."
  204.     Else
  205.       RCode = GetErrorString(JobNum)
  206.       MsgBox "PESetNthTableLocation Error #: " + Str(ErrorCode) + " - " + RCode
  207.         
  208.       Exit Sub
  209.     End If
  210. End Sub
  211. Sub Command7_Click ()
  212.    Dim nTables As Integer
  213.    nTables = PEGetNTables(JobNum)
  214.    If (tableN < nTables - 1) Then
  215.       tableN = tableN + 1
  216.    End If
  217. End Sub
  218. Sub Command8_Click ()
  219.    Dim nTables As Integer
  220.    If (tableN > 0) Then
  221.       tableN = tableN - 1
  222.    End If
  223. End Sub
  224. Sub Form_Load ()
  225.    Statusbar.Caption = "Ready"
  226.    tableN = 0
  227. End Sub
  228. Sub MenuConnectivityDLL_Click ()
  229.  MsgBox DLLName
  230. End Sub
  231. Sub MenuConnectivityDLLtype_Click ()
  232.   If DLLName = "PDSODBC.DLL" Or DLLName = "pdsodbc.dll" Then
  233.    MsgBox "Connection via ODBC."
  234.   Else
  235.    MsgBox "Connection via Q+E Lib."
  236.   End If
  237. End Sub
  238. Sub MenuExitSQLLogon_Click ()
  239.    Unload Me
  240. End Sub
  241. Sub MenuFileExit_Click ()
  242.  Unload Me
  243. End Sub
  244.